Skip to content

release: v0.8.0-alpha.1 — module migration, AX-6 testify replacement, AX-10 scaffold#4

Open
Snider wants to merge 1 commit intomainfrom
release/v0.8.0-alpha.1
Open

release: v0.8.0-alpha.1 — module migration, AX-6 testify replacement, AX-10 scaffold#4
Snider wants to merge 1 commit intomainfrom
release/v0.8.0-alpha.1

Conversation

@Snider
Copy link
Copy Markdown
Contributor

@Snider Snider commented Apr 25, 2026

Summary

Consolidates the v0.8.0-alpha.1 release work for core/go-session.

Headline changes

  • Module path migrationforge.lthn.ai/core/go-sessiondappco.re/go/session. All sibling dappco.re/go/* deps pinned to v0.8.0-alpha.1.
  • AX-6 testify removal — replaced testify assertions with stdlib testing patterns across the test suite. Removes external test framework dep in favour of the universal Core test contract.
  • AX-6 annotation — intrinsic banned imports annotated where their use is structurally required (boundary functions, justified by comment).
  • AX-10 scaffoldtests/cli/session/Taskfile.yaml + test driver for the session CLI surface.
  • Stale path cleanup — minor housekeeping of references to the pre-migration module path.

Refs

  • RFC-CORE-008-AGENT-EXPERIENCE.md (AX-1, AX-6, AX-10)

Test plan

  • go test ./... passes
  • tests/cli/session Taskfile drivers exercise the CLI surface
  • CodeRabbit review

Co-authored-by: Athena athena@lthn.ai
Co-authored-by: Hephaestus hephaestus@lthn.ai
Co-authored-by: Cladius Maximus cladius@lthn.ai

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated module path structure for improved organisation.
  • Tests

    • Enhanced internal test infrastructure with new testing utilities.
    • Added comprehensive CLI testing suite to validate end-to-end functionality.
  • Refactor

    • Streamlined testing framework dependencies and improved test maintainability.
    • Added documentation to internal imports for code clarity.

… AX-10 scaffold

Consolidates the v0.8.0-alpha.1 release work for core/go-session.

* Module path migration: forge.lthn.ai/core/go-session ->
  dappco.re/go/session. All sibling dappco.re/go/* deps pinned to
  v0.8.0-alpha.1.

* AX-6 testify removal: replaced testify assertions with stdlib
  testing patterns across the test suite. Removes external test
  framework dep in favour of the universal Core test contract.

* AX-6 annotation: intrinsic banned imports annotated where their
  use is structurally required (boundary functions, justified by
  comment).

* AX-10 scaffold: tests/cli/session/Taskfile.yaml + test driver
  for the session CLI surface.

* Stale path cleanup: minor housekeeping of references to the
  pre-migration module path.

Refs: RFC-CORE-008-AGENT-EXPERIENCE.md (AX-1, AX-6, AX-10)

Co-authored-by: Athena <athena@lthn.ai>
Co-authored-by: Hephaestus <hephaestus@lthn.ai>
Co-authored-by: Cladius Maximus <cladius@lthn.ai>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

The pull request removes the testify testing framework as an external dependency and replaces it with local test helper functions. It renames the Go module from dappco.re/go/core/session to dappco.re/go/session, adds inline documentation comments to imports throughout the codebase, and introduces a new end-to-end CLI test programme that validates session generation, parsing, analysis, searching, and HTML rendering.

Changes

Cohort / File(s) Summary
Import Documentation
analytics.go, core_helpers.go, html.go, parser.go, search.go, video.go
Added inline explanatory comments to existing imports without modifying import symbols or functional code logic.
Test Assertions Migration
analytics_test.go, html_test.go, parser_test.go, search_test.go, video_test.go
Removed testify assert and require dependencies and migrated all assertion calls to local helper functions whilst preserving test expectations.
Test Convention Message
conventions_test.go
Updated failure message to instruct using dappco.re/go/... paths instead of dappco.re/go/core/... when banned import detected.
Test Helper Framework
test_helpers_test.go
Introduced centralised unexported test helper functions (requireNoError, requireNotNil, assertEqual, assertEmpty, assertContains, etc.) with reflection-based nil and emptiness detection.
Module Configuration
go.mod
Renamed module from dappco.re/go/core/session to dappco.re/go/session and removed testify and related transitive dependencies from explicit requirements.
End-to-End CLI Tests
tests/cli/session/Taskfile.yaml, tests/cli/session/main.go
Added new task file configuring Go build cache and workspace mode, plus new test programme validating session lifecycle operations including generation, parsing, analysis, searching, and HTML timeline rendering.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.49% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main changes: module migration, testify replacement, and AX-10 scaffold for the v0.8.0-alpha.1 release.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test_helpers_test.go`:
- Around line 170-178: assertInDelta currently lets calls with NaN or negative
delta silently pass; update the function (assertInDelta) to first validate
inputs by using math.IsNaN on want and got and call t.Fatalf with a clear
message if either is NaN, then check that delta is not negative and t.Fatalf if
it is, and only after those guards compute the absolute difference and compare
to delta; also add the math import if missing and reuse testContext(msgAndArgs)
in the failure messages for consistent context.

In `@tests/cli/session/main.go`:
- Around line 72-82: The requireNoError function currently panics using string
concatenation (panic(msg + ": " + err.Error())) which bypasses the repo-standard
error construction; change it to build the error via core.E(...) and then panic
that error (e.g., panic(core.E(msg, err)) or similar wrapper signature used in
this codebase), keeping the human message and the original error attached;
update imports if necessary to reference core, and leave require(ok bool, msg
string) untouched unless it also should use core.E for consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 26403adf-2e8f-4fe3-902d-1fa3b7e9d7a7

📥 Commits

Reviewing files that changed from the base of the PR and between f06c91b and 38d5cff.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (16)
  • analytics.go
  • analytics_test.go
  • conventions_test.go
  • core_helpers.go
  • go.mod
  • html.go
  • html_test.go
  • parser.go
  • parser_test.go
  • search.go
  • search_test.go
  • test_helpers_test.go
  • tests/cli/session/Taskfile.yaml
  • tests/cli/session/main.go
  • video.go
  • video_test.go

Comment thread test_helpers_test.go
Comment on lines +170 to +178
func assertInDelta(t *testing.T, want, got, delta float64, msgAndArgs ...any) {
t.Helper()
diff := want - got
if diff < 0 {
diff = -diff
}
if diff > delta {
t.Fatalf("%swant %v within %v, got %v", testContext(msgAndArgs), want, delta, got)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

fd -i test_helpers_test.go

Repository: dAppCore/go-session

Length of output: 84


🏁 Script executed:

# Get line count and examine the file around lines 170-178
wc -l test_helpers_test.go && echo "---" && sed -n '160,185p' test_helpers_test.go

Repository: dAppCore/go-session

Length of output: 559


🏁 Script executed:

# Check current imports at top of file
head -30 test_helpers_test.go

Repository: dAppCore/go-session

Length of output: 559


🏁 Script executed:

# Verify SPDX header presence
head -1 test_helpers_test.go

Repository: dAppCore/go-session

Length of output: 100


assertInDelta silently passes when want or got is NaN.

In Go, all comparisons with NaN evaluate to false (including NaN > delta), so the function bypasses failure checks when either parameter is NaN. Guard NaN values explicitly. Also validate that delta is non-negative.

Proposed fix
 import (
+	"math"
 	"reflect"
 	"testing"

 func assertInDelta(t *testing.T, want, got, delta float64, msgAndArgs ...any) {
 	t.Helper()
-	diff := want - got
-	if diff < 0 {
-		diff = -diff
-	}
-	if diff > delta {
+	if math.IsNaN(want) || math.IsNaN(got) || math.IsNaN(delta) || delta < 0 {
+		t.Fatalf("%sinvalid delta comparison (want=%v, got=%v, delta=%v)", testContext(msgAndArgs), want, got, delta)
+	}
+	if math.Abs(want-got) > delta {
 		t.Fatalf("%swant %v within %v, got %v", testContext(msgAndArgs), want, delta, got)
 	}
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test_helpers_test.go` around lines 170 - 178, assertInDelta currently lets
calls with NaN or negative delta silently pass; update the function
(assertInDelta) to first validate inputs by using math.IsNaN on want and got and
call t.Fatalf with a clear message if either is NaN, then check that delta is
not negative and t.Fatalf if it is, and only after those guards compute the
absolute difference and compare to delta; also add the math import if missing
and reuse testContext(msgAndArgs) in the failure messages for consistent
context.

Comment thread tests/cli/session/main.go
Comment on lines +72 to +82
func require(ok bool, msg string) {
if !ok {
panic(msg)
}
}

func requireNoError(err error, msg string) {
if err != nil {
panic(msg + ": " + err.Error())
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify established non-test error-construction conventions in this repository.
rg -n --type=go -g '!**/*_test.go' '\bcoreerr\.E\s*\('
rg -n --type=go -g '!**/*_test.go' '\bcore\.E\s*\('

Repository: dAppCore/go-session

Length of output: 1620


🏁 Script executed:

#!/bin/bash
# Check imports in files that use core.E() to understand the alias
echo "=== Checking video.go imports ==="
head -30 video.go | cat -n

echo ""
echo "=== Checking parser.go imports ==="
head -30 parser.go | cat -n

Repository: dAppCore/go-session

Length of output: 3144


Use the established error construction helper instead of panic with string concatenation.

The panic(msg + ": " + err.Error()) pattern bypasses the repository-standard error wrapper and loses structured operation context. Route errors through core.E() to match established patterns across the codebase.

♻️ Proposed refactor
 import (
 	"os"
 	"strings"
 	"time"
 
+	core "dappco.re/go/core"
 	session "dappco.re/go/session"
 )
@@
-func requireNoError(err error, msg string) {
+func requireNoError(op string, err error, msg string) {
 	if err != nil {
-		panic(msg + ": " + err.Error())
+		panic(core.E(op, msg, err))
 	}
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func require(ok bool, msg string) {
if !ok {
panic(msg)
}
}
func requireNoError(err error, msg string) {
if err != nil {
panic(msg + ": " + err.Error())
}
}
import (
"os"
"strings"
"time"
core "dappco.re/go/core"
session "dappco.re/go/session"
)
func require(ok bool, msg string) {
if !ok {
panic(msg)
}
}
func requireNoError(op string, err error, msg string) {
if err != nil {
panic(core.E(op, msg, err))
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/cli/session/main.go` around lines 72 - 82, The requireNoError function
currently panics using string concatenation (panic(msg + ": " + err.Error()))
which bypasses the repo-standard error construction; change it to build the
error via core.E(...) and then panic that error (e.g., panic(core.E(msg, err))
or similar wrapper signature used in this codebase), keeping the human message
and the original error attached; update imports if necessary to reference core,
and leave require(ok bool, msg string) untouched unless it also should use
core.E for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant